package initoy

import (
	"fmt"
)

type emptySecError struct {
	fun string
}

type unclosedSectionError struct {
	line string
}

type keyUndefinedError struct {
	line string
}

type valueUndefinedError struct {
	line string
}

type sectionNotExistError struct {
	conf string
	required string
}

type createEmptyKeyError struct {
	fun string
}

type keyNotExistError struct {
	sect string
	required string
}

type fileNotExistError struct {
	file string
}

func (e *fileNotExistError) Error() string {
	return fmt.Sprintf("file %v not exist\n", e.file)
}

func (e *emptySecError) Error() string {
	return fmt.Sprintf("empty section name at function %s\n", e.fun)
}

func (e *unclosedSectionError) Error() string {
	return fmt.Sprintf("unclosed section: %s\n", e.line)
}

func (e *keyUndefinedError) Error() string {
	return fmt.Sprintf("key undefined: %s\n", e.line)
}

func (e *valueUndefinedError) Error() string {
	return fmt.Sprintf("value undefined: %s\n", e.line)
}

func (e *sectionNotExistError) Error() string {
	return fmt.Sprintf("Required section %s not exist at configuration %s\n", e.required, e.conf)
}

func (e *createEmptyKeyError) Error() string {
	return fmt.Sprintf("Tempt to create empty key at funcion %s\n", e.fun)
}

func (e *keyNotExistError) Error() string {
	return fmt.Sprintf("error when getting key of section %q: key %q not exists\n", e.sect, e.required)
}